<%@ page language="java" import="java.util.*" import="java.sql.*" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<div class="modal fade" id="upfytModal<%=id%>" tabindex="-1" aria-labelledby="upModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="upModalLabel<%=id%>">修改观影厅</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form action="ad_fyt.jsp?y_id=<%=y_id%>" method="post">
                    <div class="form-group" style="display: none">
                        <label for="u_id">ID:</label>
                        <input type="text" name="u_id" value="<%=id%>" required class="form-control" id="u_id">
                    </div>
                    <div class="form-group" style="display: none">
                        <label for="u_c_id">影院名称:</label>
                        <input type="text" name="u_y_id" value="<%=y_id%>" required class="form-control" id="u_c_id">
                    </div>
                    <div class="form-group">
                        <label for="u_name">观影厅名称:</label>
                        <input type="text" name="u_f_name" value="<%=f_name%>"  required class="form-control" id="u_name">
                    </div>
                    <div class="form-group">
                        <label for="u_g_id">播放的电影:</label>
                        <select class="form-control"  name="u_g_id" id="u_g_id">
                            <%
                                Connection cn2 = null;
                                PreparedStatement ps2 = null;
                                cn2 = DBUtil.getConnection();
                                String sql2 = "";
                                ResultSet rs2 = null;

                                sql2 = "SELECT id,name from goods";
                                ps2 = cn2.prepareStatement(sql2);
                                rs2 = ps2.executeQuery();
                                while(rs2.next()){
                                    int o_id2 = rs2.getInt("id");
                                    String s = rs2.getString("name");
                            %>
                            <option value="<%=o_id2%>" <%if (g_name.equals(s)){%> selected <%}%>><%=s%></option>
                            <%
                                }
                            %>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="u_time">开始时间:</label>
                        <input name="u_time" value="<%=time%>" required type="time" id="u_time">
                    </div>
                    <div class="form-group">
                        <label for="u_o_time">结束时间:</label>
                        <input name="u_o_time" value="<%=o_time%>" required type="time" id="u_o_time">
                    </div>
                    <div class="form-group">
                        <label for="u_language">语言:</label>
                        <input type="text" value="<%=language%>" name="u_language" required class="form-control" id="u_language">
                    </div>
                    <div class="form-group">
                        <label for="u_qian">最低金额:</label>
                        <input type="number" value="<%=qian%>" name="u_qian" required class="form-control"
                               id="u_qian">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">确认</button>
                    </div>
                </form>

            </div>

        </div>
    </div>
</div>
<script>
    function xiugai(id) {
        console.log(id)
    }
</script>
